Recreate single named schema handling across Map methods#9597
Merged
tobias-tengler merged 2 commits intomainfrom Apr 24, 2026
Merged
Recreate single named schema handling across Map methods#9597tobias-tengler merged 2 commits intomainfrom
tobias-tengler merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates HotChocolate adapter endpoint/document mapping to better handle the “single named schema” case by auto-resolving the schema name when the caller does not specify one.
Changes:
- Add schema-name auto-resolution via
IRequestExecutorProvider.SchemaNameswhen exactly one schema is registered. - Apply this resolution consistently across OpenAPI endpoint mapping, OpenAPI document transformer wiring, and MCP endpoint mapping.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/Extensions/OpenApiOptionsExtensions.cs | Resolve schema name at transformer execution time when only one schema exists. |
| src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/Extensions/EndpointRouteBuilderExtensions.cs | Resolve schema name before retrieving keyed OpenAPI endpoint data source. |
| src/HotChocolate/Adapters/src/Adapters.Mcp.Core/Extensions/EndpointRouteBuilderExtensions.cs | Resolve schema name before retrieving keyed MCP handler proxy. |
Comments suppressed due to low confidence (1)
src/HotChocolate/Adapters/src/Adapters.Mcp.Core/Extensions/EndpointRouteBuilderExtensions.cs:24
- Please add an integration test for the new schemaName auto-resolution: when exactly one schema is registered with a non-default name, MapGraphQLMcp() should work when called without an explicit schemaName (i.e., it should resolve the keyed StreamableHttpHandlerProxy for that schema).
TryResolveSchemaName(endpoints.ServiceProvider, ref schemaName);
schemaName ??= ISchemaDefinition.DefaultName;
var streamableHttpHandler =
endpoints.ServiceProvider.GetKeyedService<StreamableHttpHandlerProxy>(schemaName)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.